package cn.calm.entity;

import java.util.Comparator;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import cn.calm.commons.entity.BaseEntity;

@Entity
@Table(name = "application")
public class Application implements Comparator<Application>,BaseEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id
	@TableGenerator(name = "APPLICATION_SEQ", table = "sequence", pkColumnName = "KEYID", valueColumnName = "KEYVALUE", pkColumnValue = "APPLICATION_ID",allocationSize=1)
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "APPLICATION_SEQ")
	private String id;
	private String name;
	private String path;
	private String icon;
	private String used;
	private String type; // 0网页 ,1函数
	private String description;

	@Override
	public Object getValue() {
		return getName();
	}

	@Override
	public String getDisplayName() {
		return "快捷方式";
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUsed() {
		return used;
	}

	public void setUsed(String used) {
		this.used = used;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Override
	public int compare(Application o1, Application o2) {
		return o1.getName().compareTo(o2.getName());
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
}
